<%-- 
    Document   : calculoPotencia
    Created on : 12-jul-2009, 13:40:36
    Author     : Ale
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" import="java.util.*, electricity.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>

    <%if (request.getSession(false) != null) {%>
    <table align="center" width="1000" border="0">
        <tr>
        <td>
        <div id="menu" align="center"><jsp:include page="./menu principal.jsp"></jsp:include></div>
        <br>
        <p id="campoAzul" align="center" valign="middle" width="235px"><span id="blanco">Electricidad</span><br></p>
        <span id="azulTitulo"> Contratos y Facturas actuales</span>
        <div id="general">
        <div id="cuenta" align="center" >
            <%
        Map m = new HashMap();
        String alumbrado = request.getParameter("alumbrado");
        if(alumbrado == null)
            alumbrado = "0";
        int alumb = Integer.parseInt(alumbrado);
        m.put("alumb", alumb);

        String electro = request.getParameter("electro");
        if(electro == null)
            electro = "0";
        int elec = Integer.parseInt(electro);
        m.put("elec", elec);

        String lavadora = request.getParameter("lavadora");
        if(lavadora == null)
            lavadora= "0";
        int lavad = Integer.parseInt(lavadora);
        m.put("lavad", lavad);

        String lavavajillas = request.getParameter("lavavajillas");
        if(lavavajillas == null)
            lavavajillas ="0";
        int lavav = Integer.parseInt(lavavajillas);
        m.put("lavav", lavav);

        String horno = request.getParameter("horno");
        if(horno == null)
            horno = "0";
        int horn = Integer.parseInt(horno);
        m.put("horn", horn);

        String vitroceramica = request.getParameter("vitroceramica");
        if(vitroceramica == null)
            vitroceramica = "0";
        int vitro = Integer.parseInt(vitroceramica);
        m.put("vitro", vitro);

        String calefaccion = request.getParameter("calefaccion");
        if(calefaccion == null)
            calefaccion = "0";
        int calef = Integer.parseInt(calefaccion);
        m.put("calef", calef);

        String calefaccionV = request.getParameter("calefaccionV");
        if(calefaccionV == null)
            calefaccionV = "0";
        int calefV = Integer.parseInt(calefaccionV);
        m.put("calefV", calefV);

        String aire = request.getParameter("aire");
        if (aire == null)
            aire = "0";
        int air = Integer.parseInt(aire);
        m.put("air", air);

        String aireV = request.getParameter("aireV");
        if (aireV == null)
            aireV = "0";
        int airV = Integer.parseInt(aireV);
        m.put("airV", airV);

        double power = new CalculoPotencia().recomendarPotencia(m);

        %>
<br><br>
    <span id="azulTitulo" style="color:red"> La Potencia que Domeco le recomienda según los datos introducidos es <%=power%> W</span>







        </div>
    </div>

    <div id="abajo" align="center"><p>&copy;   Domeco &mdash; Proyecto Informático A&ntilde;o 2009 </p></div>
    </td>
    </tr>
    </table>
    <%} else {%>
    <jsp:forward page="./index.jsp"></jsp:forward>
    <%}%>
</body>
</html>






